package com.dtsz.m2.ui.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.android.volley.Request;
import com.dtsz.m2.R;
import com.dtsz.m2.config.UrlConfig;
import com.dtsz.m2.ui.base.BaseActivity;
import com.dtsz.m2.ui.model.HomeVo;
import com.dtsz.m2.volley.state.HUCState;

public class ServiceActivity extends BaseActivity {
    private TextView tvQq;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_service);
        super.onCreate(savedInstanceState);
        tvActionbarTitle.setText("联系我们");
    }

    @Override
    public void initView() {
        super.initView();
        tvQq = findViewById(R.id.tvQq);
    }

    @Override
    protected void onStart() {
        super.onStart();
        getQQ();
    }

    private void getQQ() {
        //获取网络数据
        pageVo.setLikeName("QQ");
        hucRequestInterfase.executeStr(this, HomeVo.class,
                HUCState.HUC_REQEUST_CODE_5, Request.Method.POST, UrlConfig.VERSION_URL,
                hucParameInterfase.getRequestParameter(pageVo), true);
    }


    @Override
    public void onSuccessfulStrType(int inputType, Object response) {
        super.onSuccessfulStrType(inputType, response);
        switch (inputType) {
            case HUCState.HUC_REQEUST_CODE_5:
                if (response instanceof HomeVo) {
                    HomeVo homeVo = (HomeVo) response;
                    tvQq.setText(homeVo.getContent());
                }
                break;
        }
    }
}
